package com.frame.session;

import javax.servlet.http.HttpSession;
import com.frame.pageform.RequestContext;
import com.frame.platform.user.SessionOaUser;


public class UserSession{
	private static final String adminUser="adminUserSession_";
	private static final String webUser="webUserSession_";

	public static SessionOaUser getAdminUser(HttpSession session) throws Exception{
		return (SessionOaUser)session.getAttribute(adminUser);
	}
	public static SessionOaUser getAdminUser(){

		return (SessionOaUser)RequestContext.getContext().getRequest().getSession().getAttribute(adminUser);
	}

	public static void setAdminUser(HttpSession session,SessionOaUser user){
		session.setAttribute(adminUser,user);
	}

	public static void setWebUser(HttpSession session,SessionUser user){
		session.setAttribute(webUser,user);
	}
	public static SessionUser getWebUser(HttpSession session){
		return (SessionUser)session.getAttribute(webUser);
	}
	public static SessionUser getWebUser(){
		return (SessionUser)RequestContext.getContext().getRequest().getSession().getAttribute(webUser);
	}
	public static String getAdminUserSessionName() {
		return adminUser;
	}
	public static String getWebUserSessionName() {
		return webUser;
	}
}
